import request from "./request";

export const creatAdmin = (value: any) => {
    return request({
        method: "post",
        url: "rest/adminUser",
        data: value,
    });
};

//获取管理员列表数据
export const getAdmin = () => {
    return request({
        method: "get",
        url: "rest/adminUser",
    });
};

//获取被编辑数据的详情
export const getAdminMsg = (id: string[] | string) => {
    return request({
        method: "get",
        url: `rest/adminUser/${id}`,
    });
};

//更新数据
export const upDateAdmin = (id: string | string[], data: any) => {
    return request({
        method: "put",
        url: `rest/adminUser/${id}`,
        data: data,
    });
};

//删除管理员
export const deletAdmin = (id: string | string[]) => {
    return request({
        method: "delete",
        url: `rest/adminUser/${id}`,
    });
};
